package com.itheima.pinda.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.pinda.DTO.entity.PdAuthUser;
import com.itheima.pinda.mapper.PdAuthUserMapper;
import com.itheima.pinda.service.PdAuthUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户 服务实现类
 * </p>
 *
 * @author xsf
 * @since 2021-11-11
 */
@Service
public class PdAuthUserServiceImpl extends ServiceImpl<PdAuthUserMapper, PdAuthUser> implements PdAuthUserService {

    @Autowired
    private PdAuthUserMapper authUserMapper;

    @Override
    public PdAuthUser queryUserByName(String name) {
        QueryWrapper<PdAuthUser> pdAuthUserQueryWrapper = new QueryWrapper<>();
        pdAuthUserQueryWrapper.eq("account",name);
        PdAuthUser pdAuthUser = authUserMapper.selectOne(pdAuthUserQueryWrapper);

        return pdAuthUser;
    }

    @Override
    public PdAuthUser queryById(String id) {
        PdAuthUser pdAuthUser = authUserMapper.selectById(id);
        return pdAuthUser;
    }
}
